import { createRef } from "react";
import { Outlet, Navigate } from "react-router-dom";
import { SuspenseComponent } from "@/utils/MyFun";

const message = {
  name: "消息管理",
  path: "/message",
  element: <Outlet />,
  nodeRef: createRef(null),
  meta: {
    title: "消息管理",
    icon: "ic:twotone-email",
    order: 2,
    keepAlive: true,
    // role: ['admin'],
    // requireAuth: true,
  },
  children: [
    {
      path: "/message",
      element: <Navigate to="/message/comment" />,
      nodeRef: createRef(null),
      redirect: true,
    },
    {
      name: "评论管理",
      path: "comment",
      element: SuspenseComponent("/message/comment"),
      nodeRef: createRef(null),
      isHidden: false,
      meta: {
        title: "评论管理",
        icon: "ic:twotone-comment",
        keepAlive: true,
        order: 1,
      },
    },
    {
      name: "留言管理",
      path: "leave-msg",
      element: SuspenseComponent("/message/leave-msg"),
      nodeRef: createRef(null),
      isHidden: false,
      meta: {
        title: "留言管理",
        icon: "ic:twotone-message",
        keepAlive: true,
        order: 2,
      },
    },
  ],
};

export default message;
